package top.wshape1.shiziapi.project.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * @author Wshape1
 * @version 1.0
 * @description
 * @since 2023-09-14
 */

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProjectVo {


    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    @NotBlank
    @Pattern(regexp = "^[\\u4e00-\\u9fa5_a-zA-Z0-9-]+$", message = "名称异常，不能包含除_-以外的字符！")
    @Length(max = 64)
    private String name;

    @Pattern(regexp = "(^[\\u4e00-\\u9fa5_a-zA-Z0-9-,.，。]+$)?", message = "简介异常，不能包含除_-以外的字符！")
    @Length(max = 255)
    private String description;

    @Min(value = 0L)
    @Max(value = 1L)
    @NotNull
    private Integer isPrivate;

}
